From c89b3ee9c4961092436b6bc287b266be1fa52ed0 Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 1 Dec 2005 20:01:16 +0000 Subject: [PATCH] prevent a potential but currently impossible segfault that could happen when an fs-copy function just does a memcpy git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1607 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/formspec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpsbabel/formspec.c b/gpsbabel/formspec.c index 1c20c53c9..ce1dbf90b 100644 --- a/gpsbabel/formspec.c +++ b/gpsbabel/formspec.c @@ -31,6 +31,8 @@ format_specific_data *fs_chain_copy( format_specific_data *source ) { format_specific_data **copy = &result; while ( source ) { source->copy( (void **)copy, (void *)source ); + /* prevent segfaults from badly-behaved copy functions */ + (*copy)->next = NULL; copy = &((*copy)->next); source = source->next; } -- 2.30.2